<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>leNong管理员登录</title>
    <link rel="stylesheet" href="../../stylesheets/usual_class.css">
    <link href="css/signin.css" rel="stylesheet">
    <script src="../../js/angular-1.5.7.js"></script>
    <script src="../../js/angular-route.min.js"></script>
</head>

<body ng-app='login'>
    <div class="signin" ng-controller="login_controller">
        <div class="signin-head">
            <img ng-src="{{img_src}}" alt="" class="circle">
        </div>
        <form class="form-signin" name="userForm" ng-submit="submitForm(userForm.$valid)" novalidate>
            <input class="mb4" type="text" name="phnum" ng-model="phnum" id="phone_number" ng-pattern="/^1[3|4|5|6|7|8][0-9]\d{8}$/" placeholder="手机" required autofocus maxlength="15" />
            <div class="fs12 c-red" ng-show="userForm.phnum.$invalid && !userForm.phnum.$pristine"><span>请确认号码有效</span></div>
            <div class="flex-box mt8 mb4">
                <input type="text" name="vrfc" ng-model="vrfc" id="vrfc_code" class="flex1 d-b mr8" placeholder="验证码" required maxlength="8" />
                <div class="btn bg-cyan va-b fs12" id="get_vrfc" ng-click="get_vrfc()">获取验证码</div>
            </div>
            <div class="fs12 c-red" ng-show="userForm.vrfc.$invalid && !userForm.vrfc.$pristine"><span>请填写验证码</span></div>
            <div class="flex-box mt16 mb4">
                <button class="flex-btn flex1 bg-orange fs16" type="submit">登录</button>
            </div>
            <div class="fs12 c-red" ng-show="isInValid"><span>请再次检查</span></div>
            <div class="p16 ta-c" ng-show="loading">
                <img src="../../images/loadingA.gif" alt="">
            </div>
        </form>
    </div>
    </div>
</body>
<script>
/**
 * login Module
 *
 * Description
 */
var login_app = angular.module('login', ['ngRoute']);
login_app.controller('login_controller', function($scope) {
    $scope.isInValid = false;
    $scope.loading = false;
    $scope.img_src = "images/test/head_120.png";
    $scope.phnum = '';
    $scope.vrfc = '';
    $scope.get_vrfc = function() {

    }
    $scope.submitForm = function(isValid) {
        console.log(isValid)
        if (isValid) {
            $scope.isInValid = false;
            $scope.loading = true;
        } else {
            $scope.isInValid = true;
        }

    }
});
</script>

</html>
